/**
 * I18nMessageTag.java
 * Product:BaseLayer
 * Version:1.0
 * Copyright 2009 by DNE
 * All Rights Reserved.
 */
package com.site.util;

import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;

/**
 * 翻页标签
 */
public class PageParamTag extends TagSupport {


	private static final long serialVersionUID = -8963957071950556995L;
	private String name;


	private String value;
	@Override
	public int doEndTag() throws JspTagException {
		
		Tag tag=(Tag)getParent();
		if(tag instanceof PageTag)
		{
			PageTag pageTag=(PageTag)tag;
			pageTag.getParamMap().put(name, value);
		}
		else if (tag instanceof FrontPageTag1)
		{
			FrontPageTag1 pageTag=(FrontPageTag1)tag;
			pageTag.getParamMap().put(name, value);
		}
		//食品专区分页 冉可 2011-8-15 开始
		else if (tag instanceof FoodPageTag)
		{
			FoodPageTag pageTag=(FoodPageTag)tag;
			pageTag.getParamMap().put(name, value);
		}
		//食品专区分页 冉可 2011-8-15 结束
		else if (tag instanceof PointPageTag) {
			PointPageTag pageTag = (PointPageTag)tag;
			pageTag.getParamMap().put(name, value);
		}
		/*
		//手机分页
		else if (tag instanceof MobilePageTag) {
			MobilePageTag pageTag = (MobilePageTag)tag;
			pageTag.getParamMap().put(name, value);
		}
		*/
	    return EVAL_PAGE;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
